<?php
include '../conn.php';
$data = json_decode($HTTP_RAW_POST_DATA);
$sql = "select * from users_info
        where id = $data->userId
        limit 1";
$isUser = $pdo->getOne($sql);
if($isUser){
    $sql = "select status from users_like
            where user_id = $data->userId and notice_id = $data->noticeId
            limit 1";
    $like = $pdo->getOne($sql);
    $sql = "select status from users_collect
            where user_id = $data->userId and notice_id = $data->noticeId
            limit 1";
    $collect = $pdo->getOne($sql);
    $arr = [
        "like" => $like['status'],
        "collect" => $collect['status']
    ];
}else{
    $arr = [
        "code" => 400,
        "desc" => '用户信息错误,请重试'
    ];
}
echo json_encode($arr);
exit;